SMODS.Blind#
Class prefix: bl
Required parameters:
keyloc_txtor localization entry (reference)
Optional parameters (defaults)
atlas = 'blind_chips', pos = { x = 0, y = 0 }(reference)To have an animated sprite like vanilla Blinds set
atlas_table = 'ANIMATION_ATLAS'. Theyvalue determines the row to use for the animation. Thexvalue is ignored and cycles through each frame of the animation.
config = {}, discovered = false, no_collection, prefix_config, dependencies(reference)configvalues are saved underG.GAME.blind.effect.
dollars = 5: Amount of money obtained when defeated.mult = 2: Required score relative to the Ante’s Base score.boss: Marks this Blind as a Boss Blind and specifies on which Antes it can appear ({ min = 1, max = 10 }).maxis an artifact and not functional. Usein_poolinstead for advanced conditions.boss.showdown: Marks this Blind as a Final Boss Blind that shows up on every multiple of the winning Ante.minis ignored, usein_poolto restrict spawning.
boss_colour: Sets the background colour to use while playing this Blind (e.g.HEX('56789A'))debuff = {}: Configure vanilla Blind effects with these fields:Disallowing hands in full:
hand = { ['Hand Type'] = true}for a specific set of hands,h_size_ge = n, must play at leastncards,h_size_le = n, must play at mostncards.
Debuffing cards:
suit = 'Hearts'for one specific suit,value = '2'for one specific rank,nominal = nfor all ranks scoringnbase chips,is_face = truefor all face cards.
These effects are ignored if you specify a
debuff_handordebuff_cardfunction respectively.
ignore_showdown_check: Enabling this allowsin_poolto be evaluated regardless of whether a showdown Boss Blind was requested or not.vars = {}: variables for the Blind’s description in the collection. Fallback ifcollection_loc_varsisn’t set.modifies_draw: Set to true if the blind modifies the draw similar toThe Serpent. This will not handle the functionality but it is necessary for the effects to apply properly.
API methods#
In all of the following methods, use the global variable G.GAME.blind to
refer to the current blind. (The base game uses self to refer to the current blind in Blind:foo().)
set_blind(self)Effects that activate when this Blind is selected
calculate(self, blind, context) -> table(reference)This method is both called directly on the center and from
Blind:calculate()and incorporated into the standard calculation pipeline. Several blind functions below can be handled here via checking their respective calculation context.
calc_dollar_bonus(self, blind) -> number, table(Added in 1531zeebee)
For awarding money at the end of the round (e.g. Delayed Gratification, Cloud Nine)
Optionally, you can return a table as the second value to modify the text in the round evaluation screen with any of the following arguments:
text: Replaces the default name text.key,set: Allows changing the key and/or set of the name in the localization (ignored iftextis set)vars: (Added in 1814a) Replaces the variables (e.g.#1#) in names sourced from the localization.text_colour,scale: Allows changing the colour and scale of the text respectively
disable(self)Reverting effects when this Blind gets disabled
defeat(self)Reverting effects when this Blind is defeated
drawn_to_hand(self)Effects that activate when cards are drawn to hand
press_play(self)Effects that activate when a hand is played
recalc_debuff(self, card, from_blind) -> boolDetermines what cards should be debuffed by this Blind
debuff_hand(self, cards, hand, handname, check) -> boolDetermines if a hand is disallowed by this Blind
stay_flipped(self, area, card) -> boolDetermines what cards are drawn face down
modify_hand(self, cards, poker_hands, text, mult, hand_chips) -> number, number, boolUsed for modifications on the base score of played hands. Expected return values in order are:
The modified value of
multThe modified value of
hand_chipsA boolean value indicating whether any values were changed
get_loc_debuff_text(self) -> stringAllows modifying text displayed for debuff warnings on invalid hands
loc_vars(self) -> { vars ?= table, key ?= string }(reference)Due to various constraints, the functionality of
loc_varson blinds is very limited. Onlyvars,setandkeyreturns are supported, and noinfo_queueexists.
collection_loc_vars(self) -> { vars ?= table, key ?= string }Used for passing variables to Blind descriptions when viewing the collection. If not defined, the game will use the
varsfield on your object.
in_pool(self) -> boolFor implementing advanced restrictions on when a Blind may appear in a run. This puts
boss.minandboss.maxrestrictions out of effect.Unless
ignore_showdown_checkis set, this function will not be evaluated in the following cases:A showdown Boss Blind should appear, but this Blind is a regular Boss Blind.
A regular Boss Blind should appear, but this Blind is a showdown Boss Blind.